<!DOCTYPE html>
<html lang="zh-CN"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>登录</title>
    <link rel="stylesheet" href="/tools/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/tools/font-awesome/css/font-awesome.css"/>
    <link rel="stylesheet" href="/css/comm.css"/>
    <link rel="stylesheet" href="/css/login.css"/>
</head>
<body>
<div class="babyImg">

    <div class="wrapper main">
        <div class="loginColumns">
            <div class="row">
                <div class="col-md-6" style="padding: 1px 30%;">
                    <div class="ibox-content" style="width: 380px;" id="app">
                        <div class="title"> 用户登录</div>
                        <div class="error hide">
                            <i class="error-icon"></i>
                            <span></span>
                        </div>
                        <form class="m-t" action="#" method="post">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="输入账号/手机号码" v-model="params.account"/>
                            </div>
                            <div class="form-group">
                                <input type="password" class="form-control" placeholder="输入密码"  v-model="params.pwd"/>
                            </div>
                            <button type="button" class="btn btn-primary block full-width m-b" @click="login">登录 </button>
                            <p class="text-muted text-right">
                                <a href="forget_password.html">忘记密码</a>
                                <a href="register.html" style="display:inline-block;margin-left: 10px;">注册账号</a>
                            </p>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/tools/jquery/jquery-3.2.1.min.js"></script>
<script src="/tools/vue.min.js"></script>
<script src="/tools/layer/layer.js"></script>
<script src="/javaScript/common.js"></script>
<script src="/javaScript/ajaxDataController.js"></script>
<script type="application/javascript">
    var type = common.request.getParam("type");
    if(type=='sessionOut'){
        common.layer.fail("登录失败，请重新登录！",function(){
            top.window.location.href = "/defaultLogin";
        });
    }
    var vue = new Vue({
        el:"#app",
        data:{
            params:{account:"",pwd:""}
        },
        methods: {
            login:function(){
                ajaxDataController().post("/login/userLogin",this.params,function(data){
                    if(data.resultObject==true){
                        window.location.href='/index/indexPage';
                    }
                })
            }
        }
    });
</script>
</body>
</html>
